package com.tgy.hash.type;

/**
 * @Author: tgy
 * @Date: 2020-09-24 09:39
 */
public class DoubleHash {


    public static void main(String[] args) {

        Double num = 10.11;

        /**
         * 先获取内存地址中存放double的二进制值，然后对二进制对高32位与低32位进行异或操作
         *  public static int hashCode(double value) {
         *         long bits = doubleToLongBits(value);
         *         return (int)(bits ^ (bits >>> 32));
         *  }
         */
        int hashCode = num.hashCode();

        System.out.println(hashCode);

    }

}
